#!/bin/bash

echo "正在启动本地开发环境..."

echo ""
echo "1. 启动PostgreSQL数据库..."
docker-compose up -d postgres

echo ""
echo "2. 等待数据库启动..."
sleep 5

echo ""
echo "3. 创建数据库（如果不存在）..."
docker-compose exec -T postgres psql -U postgres -c "CREATE DATABASE portfolio_db;" 2>/dev/null || true

echo ""
echo "4. 启动应用服务..."
npm run dev